package com.jtny.nytb.powermonitor.vo;

import cn.hutool.core.util.NumberUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 数据参量展示VO类对象
 *
 * @author 智慧能源中心 - 车智斌
 * @package com.jtny.nytb.powermonitor.vo
 * @fileName DataVO.java
 * @createTime 2023年10月10日 16:06
 * @Copyright© 2023 jtny
 * 江投能源技术研究院 版权所有
 */
@ApiModel(value = "数据参量展示VO类对象")
@Data
public class DataVO implements Serializable {


    @ApiModelProperty("统一参量标识值的名称")
    private String key;

    @ApiModelProperty("统一参量标识值的单位")
    private String unit;

    @ApiModelProperty("统一参量标识值的值")
    private String value;

    public DataVO buildSF(Double value, String time) {
        this.key = time + "碳排放量";
        this.unit = "kgco2";
        this.value = NumberUtil.roundStr(value, 2);
        return this;
    }

    public DataVO buildEPI(Double value, String time) {
        this.key = time + "正向有功电能";
        this.unit = "kwh";
        this.value = NumberUtil.roundStr(value, 2);
        return this;
    }

    public DataVO buildE(Double value, String time) {
        this.key = time + "综合能耗";
        this.unit = "kgce";
        this.value = NumberUtil.roundStr(value, 2);
        return this;
    }

    public DataVO buildWaterConsumption(Double value, String time) {
        this.key = time + "用水量";
        this.unit = "m3";
        this.value = NumberUtil.roundStr(value, 2);
        return this;
    }

}
